import { getCategoryAPI } from "@/apis/Layout"
import { defineStore } from "pinia"
import { ref } from 'vue'

export const useCategoryStore = defineStore('category', () => {
   // 导航列表数据管理
   // state
   const categoryList = ref([])
   // action 获取导航列表数据方法
   const getCategory = async () => {
      const res = await getCategoryAPI()
      categoryList.value = res.result
   }
   return {
      categoryList,
      getCategory
   }
})